<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2018/10/29
  Time: 9:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="../bootstrap/js/jquery.min.js"></script>
    <script src="../bootstrap/js/bootstrap.min.js"></script>
    <title>一级分类</title>
    <style>
        tr,th{
            text-align: center;
        }
        h3{
            text-align: center;
        }
        #back{
            float: right;
        }
    </style>
</head>
<body>
<h3>一级分类列表</h3>
<c:set var="root" value="${pageContext.request.contextPath}"/>
<table class="table table-bordered table-hover">
    <thead>
    <tr>
        <th>
            编号
        </th>
        <th>
            一级分类名称
        </th>
        <th>
            修改
        </th>
        <th>
            删除
        </th>
    </tr>
    </thead>
    <tbody>
    <c:set var="list" value="${sessionScope.list}"/>
    <c:forEach items="${list}" var="p" varStatus="status">
        <tr>
            <td>
                    ${status.count}
            </td>
            <td>
                    ${p.cname}
            </td>
            <td>
                <a href="${root}/updateuiServlet?cid=${p.cid}">
                    <button type="button" class="btn btn-default">修改</button>
                </a>
            </td>
            <td>
                <a href="${root}/delServlet?cid=${p.cid}">
                    <button type="button" class="btn btn-default">删除</button>
                </a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<a href="${root}/main.jsp">
    <button type="button" class="btn btn-default btn-primary" id="back">返回</button>
</a>
</body>
</html>
